﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GKQC.DbHelper.ViewModels
{
    public class ElectricViewModel
    {
        public ElectricViewModel()
        {
            this.ESR2isValid = true;
            this.LC2isValid = true;
            this.Z2isValid = true;
            this.CAPisValid = true;
            this.DFisValid = true;
            this.LCisValid = true;
            this.LC2isValid = true;
            this.ZisValid = true;
            this.ESRisValid = true;
            this.HisValid = true;
            this.L1isValid = true;
            this.L1 = "OK";
        }

        public double D { get; set; }
        public double L { get; set; }
        public double C { get; set; }
        public bool DisValid { get; set; }
        public bool LisValid { get; set; }
        public bool CisValid { get; set; }

        public double CAP { get; set; }
        public double DF { get; set; }
        public double LC { get; set; }
        public double LC2 { get; set; }
        public double Z { get; set; }
        public double Z2 { get; set; }
        public double ESR { get; set; }
        public double ESR2 { get; set; }

        /// <summary>
        /// ORT专用的High  
        /// </summary>
        public double H { get; set; }
        /// <summary>
        /// ORT专用的L1  Weight
        /// </summary>
        public string L1 { get; set; }
        /// <summary>
        /// 测试LC时检测到的电压值，过程数据
        /// </summary>
        public double RealVoltage { get; set; }
        /// <summary>
        /// 測試次數
        /// </summary>
        public int SNo { get; set; }
        public long HeadId { get; set; }

        public bool CAPisValid { get; set; }
        public bool DFisValid { get; set; }
        public bool LCisValid { get; set; }
        public bool LC2isValid { get; set; }
        public bool ZisValid { get; set; }
        public bool Z2isValid { get; set; }
        public bool ESRisValid { get; set; }
        public bool ESR2isValid { get; set; }
        public bool HisValid { get; set; }
        public bool L1isValid { get; set; }

        public void Clear()
        {
            this.CAP = 0;
            this.DF = 0;
            this.LC = 0;
            this.LC2 = 0;
            this.Z = 0;
            this.Z2 = 0;
            this.ESR = 0;
            this.D = 0;
            this.L = 0;
            this.C = 0;

            this.CAPisValid = true;
            this.DFisValid = true;
            this.LCisValid = true;
            this.LC2isValid = true;
            this.ZisValid = true;
            this.Z2isValid = true;
            this.ESRisValid = true;
            this.ESR2isValid = true;
            this.DisValid = true;
            this.LisValid = true;
            this.CisValid = true;
            this.L1 = "OK";
        }
    }
}
